package com.atsmart.app.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.atsmart.app.BizApp;
import com.atsmart.app.R;

public class MoreAdapter extends BaseAdapter {

	private LayoutInflater inflater;
	private List<String> datasource;

	public MoreAdapter() {
		inflater = (LayoutInflater) BizApp.getInstance().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		datasource = new ArrayList<String>();
		datasource.add("巡检操作");
		datasource.add("版权说明");
	}

	private static class ViewHolder{
		TextView title;
	}

	@Override
	public int getCount() {
            return 2;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder vh;
		if (convertView == null || convertView.getTag() == null) {
			convertView = inflater.inflate(R.layout.more_item_layout, null);
			vh = new ViewHolder();
			vh.title = (TextView) convertView.findViewById(R.id.title);
			convertView.setTag(vh);
		} else {
			vh = (ViewHolder) convertView.getTag();
		}
		vh.title.setText(datasource.get(position));
		return convertView;
	}

}
